import Vue from 'vue'
import App from './App'
//vuex
import store from './store'
//把vuex定义成全局组件
Vue.prototype.$store = store
import http from 'service/http.js'
import nfc from 'service/nfc.js'
import open from 'service/voice.js'
import isPhone from 'service/isphone.js'
import cuCustom  from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom)
Vue.config.productionTip = false


// vue时间过滤器
Vue.filter("format",(data)=>{
	data = data.split(' ');
	data= data[1]
	data = data.substr(0,5);
	return data
})
// 年月日过滤器
Vue.filter("formatData",(data)=>{
	data = data.split(' ');
	data= data[0]
	let time = data.split('-');
	let desc = time[0]+'年'+time[1]+'月'+time[2]+'日'
	return desc
})
// 温度
Vue.filter("temperature",(data)=>{
	let descs = data.slice(3)  
	return descs
})

// 原型
Vue.prototype.$http = http.httpRequest;
Vue.prototype.$nfc = nfc.NFCReadUID;
Vue.prototype.$nfcInit = nfc.NFCInit;
Vue.prototype.$voice =open.openVoic;
Vue.prototype.$isphone =isPhone.isPhone;
App.mpType = 'app'
const app = new Vue({
    ...App,
	//挂载
	 store
})
app.$mount()

